﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace SWGeneracionE.Models.Repositories
{

    public interface IGenericRepository<T> : IDisposable where T : class
    {

        IQueryable<T> GetAll();
        List<T> GetAllPaging(ref int count, int startIndex = 0, int pageSize = 0, string sorting = null);
        IQueryable<T> FindBy(Expression<Func<T, bool>> predicate);
        List<T> FindByPaging(Expression<Func<T, bool>> predicate, ref int count, int startIndex, int pageSize, string sorting = null);
        T FindFirst(Expression<Func<T, bool>> predicate);
        T Add(T entity);
        void Delete(T entity);
        void Edit(T entity);

        void Save();
        void Detach(T entity);
    }

}